package com.yangyouli.unity_demo_server.dao;

import com.yangyouli.unity_demo_server.annotation.InjectableDao;
import com.yangyouli.unity_demo_server.entity.User;

@InjectableDao("userDao")
public interface UserDao {
	/**
	 * 根据 id 查找用户
	 * @param id
	 * @return
	 */
	public User findById (int id);
	
	/**
	 * 根据账号查找用户
	 * @param account
	 * @return
	 */
	public User findByAccount (String account);
	
	/**
	 * 增加
	 * @param user
	 * @return
	 */
	public int insert (User user);
	
	/**
	 * 更新用户
	 * @param user
	 * @return
	 */
	public int update (User user);
	
	/**
	 * 更新邮箱，只需要有 id 和邮箱属性
	 * @param user
	 * @return
	 */
	public int updateEmail (User user);
}
